Skip to content

Fix bug #55138 PDO OCI cannot insert more than 1332 bytes #633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Fix bug #55138 PDO OCI cannot insert more than 1332 bytes #633

wants to merge 1 commit into from

Conversation

gureedo
Copy link

@gureedo gureedo commented Mar 27, 2014

According to Oracle docs value_sz defines size in bytes, not characters.
OCIBindByName() docs:
http://docs.oracle.com/cd/E16655_01/appdev.121/e17625/oci16rel003.htm#LNOCI17140

value_sz (IN)
The maximum size possible in bytes of any data value (passed using valuep) for this bind variable. 
This size is always expected to be the size in bytes. 

This fix not covers VARCHAR2 extended mode in new Oracle versions.
See max_string_size = extended at
http://docs.oracle.com/cd/E16655_01/appdev.121/e17625/oci03typ.htm#LNOCI16271

@smalyshev
Copy link
Contributor

@gureedo would you mind to add a test for it - from code in bug report https://bugs.php.net/bug.php?id=55138 ?

@gureedo
Copy link
Author

gureedo commented Apr 22, 2014

After reading docs more carefully I think implicit value with 4000 bytes is wrong as it does not show real length with different encodings.
From http://docs.oracle.com/cd/E16655_01/appdev.121/e17625/oci05bnd.htm#LNOCI16429

When you specify the OCI_DATA_AT_EXEC mode in a call to OCIBindByPos() or OCIBindByName(), 
the value_sz parameter defines the total size of the data that can be provided at run time. 
The application must be ready to provide to the OCI library the run time IN data buffers
on demand as many times as is necessary to complete the operation. When the allocated 
buffers are no longer required, they must be freed by the client.

So we can put into value_sz max value as it type can fit.

@ghost
Copy link

ghost commented Mar 7, 2015

Can one of the admins verify this patch?

@krakjoe krakjoe added the Bug label Jan 4, 2017
@krakjoe
Copy link
Member

krakjoe commented Jan 4, 2017

@gureedo can you fix conflicts please :)

Also, can I know the current status of this PR exactly ?

@gureedo
Copy link
Author

gureedo commented Jan 4, 2017

Oops, same issue as in #542. Wating for response.

@krakjoe
Copy link
Member

krakjoe commented Jan 4, 2017

Please do create a clean PR, closing this one for you.

FWIW, I'm not sure why pushing to the branch didn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants